import http from "@/common/http/index.js";


function loadUser(type,user_name,page_num,page_size){
    let data={
        type:type,
        user_name:user_name,
        page_num:page_num,
        page_size:page_size
    };
    return http.post("/admin/user/getinfo",data);
}

function updateUser(user_name,phone,email,type){
    let data={
        user_name:user_name,
        phone:phone,
        email:email,
        type:type
    };
    return http.post("admin/user/update",data)
}

function deleteUser(user_id){
    let data={
        user_id:user_id,
    };
    return http.get("admin/user/delete",data)
}

function addUser(username,phone,email,type,password){
    let data={
        username:username,
        phone:phone,
        email:email,
        type:type,
        password:password
    };
    return http.post("admin/user/add",data)
}

export default{
    loadUser,
    updateUser,
    deleteUser,
    addUser
}